Drop the _double suffix, now that the int version is gone.
gdk_surface_get_frame_extents
gdk_surface_get_origin
gdk_surface_get_root_coords
-gdk_surface_get_device_position_double
+gdk_surface_get_device_position
GdkModifierType
GdkModifierIntent
gdk_surface_get_parent
{
gdouble x, y;
- gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
+ gdk_surface_get_device_position (surface, device, &x, &y, mask);
if (axes)
{
}
/**
-* gdk_surface_get_device_position_double:
-* @surface: a #GdkSurface.
-* @device: pointer #GdkDevice to query to.
-* @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
-* @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
-* @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
-*
-* Obtains the current device position in doubles and modifier state.
-* The position is given in coordinates relative to the upper left
-* corner of @surface.
-*
-* Returns: (nullable) (transfer none): The surface underneath @device
-* (as with gdk_device_get_surface_at_position()), or %NULL if the
-* surface is not known to GDK.
-**/
+ * gdk_surface_get_device_position:
+ * @surface: a #GdkSurface.
+ * @device: pointer #GdkDevice to query to.
+ * @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
+ * @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
+ * @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
+ *
+ * Obtains the current device position in doubles and modifier state.
+ * The position is given in coordinates relative to the upper left
+ * corner of @surface.
+ *
+ * Returns: (nullable) (transfer none): The surface underneath @device
+ * (as with gdk_device_get_surface_at_position()), or %NULL if the
+ * surface is not known to GDK.
+ **/
GdkSurface *
-gdk_surface_get_device_position_double (GdkSurface *surface,
- GdkDevice *device,
- double *x,
- double *y,
- GdkModifierType *mask)
+gdk_surface_get_device_position (GdkSurface *surface,
+ GdkDevice *device,
+ double *x,
+ double *y,
+ GdkModifierType *mask)
{
-gdouble tmp_x, tmp_y;
-GdkModifierType tmp_mask;
-gboolean normal_child;
+ gdouble tmp_x, tmp_y;
+ GdkModifierType tmp_mask;
-g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
-
-tmp_x = tmp_y = 0;
-tmp_mask = 0;
-normal_child = GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
- device,
- &tmp_x, &tmp_y,
- &tmp_mask);
-/* We got the coords on the impl, convert to the surface */
-tmp_x -= surface->abs_x;
-tmp_y -= surface->abs_y;
+ g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+ g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
+ g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
-if (x)
-*x = tmp_x;
-if (y)
-*y = tmp_y;
-if (mask)
-*mask = tmp_mask;
+ tmp_x = tmp_y = 0;
+ tmp_mask = 0;
+ GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
+ device,
+ &tmp_x, &tmp_y,
+ &tmp_mask);
-if (normal_child)
-return _gdk_surface_find_child_at (surface, tmp_x, tmp_y);
-return NULL;
+ if (x)
+ *x = tmp_x;
+ if (y)
+ *y = tmp_y;
+ if (mask)
+ *mask = tmp_mask;
+
+ return NULL;
}
static gboolean
gint gdk_surface_get_scale_factor (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
-GdkSurface * gdk_surface_get_device_position_double (GdkSurface *surface,
- GdkDevice *device,
- gdouble *x,
- gdouble *y,
- GdkModifierType *mask);
+GdkSurface * gdk_surface_get_device_position (GdkSurface *surface,
+ GdkDevice *device,
+ double *x,
+ double *y,
+ GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_surface_get_parent (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
{
gdouble x_pos, y_pos;
- gdk_surface_get_device_position_double (window, device, &x_pos, &y_pos, mask);
+ gdk_surface_get_device_position (window, device, &x_pos, &y_pos, mask);
if (axes)
{
{
gdouble x, y;
- gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
+ gdk_surface_get_device_position (surface, device, &x, &y, mask);
if (axes)
{
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device);
- gdk_surface_get_device_position_double (surface, device,
- &event->crossing.x, &event->crossing.y,
- &event->crossing.state);
+ gdk_surface_get_device_position (surface, device,
+ &event->crossing.x, &event->crossing.y,
+ &event->crossing.state);
event->crossing.x_root = event->crossing.x;
event->crossing.y_root = event->crossing.y;
if (impl->position_method == POSITION_METHOD_NONE && grab_device)
{
double px, py;
- gdk_surface_get_device_position_double (transient_for, grab_device,
- &px, &py, NULL);
+ gdk_surface_get_device_position (transient_for, grab_device,
+ &px, &py, NULL);
surface->x = round (px);
surface->y = round (py);
}
{
double x, y;
- gdk_surface_get_device_position_double (window, device, &x, &y, mask);
+ gdk_surface_get_device_position (window, device, &x, &y, mask);
if (axes)
{
{
gdouble x, y;
- gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
+ gdk_surface_get_device_position (surface, device, &x, &y, mask);
if (axes)
{
if (device)
{
double px, py;
- gdk_surface_get_device_position_double (rect_surface, device, &px, &py, NULL);
+ gdk_surface_get_device_position (rect_surface, device, &px, &py, NULL);
rect.x = round (px);
rect.y = round (py);
}
* far away from the pointer position.
*/
effective_toplevel = _gtk_widget_get_surface (toplevel);
- gdk_surface_get_device_position_double (effective_toplevel,
- device,
- &px, &py, NULL);
+ gdk_surface_get_device_position (effective_toplevel, device, &px, &py, NULL);
pointer_x = round (px);
pointer_y = round (py);
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- gdk_surface_get_device_position_double (surface, device, &px, &py, NULL);
+ gdk_surface_get_device_position (surface, device, &px, &py, NULL);
x = round (px);
y = round (py);
gdk_device_get_position_double (device,
&event->crossing.x_root,
&event->crossing.y_root);
- gdk_surface_get_device_position_double (surface,
- device,
- &event->crossing.x,
- &event->crossing.y,
- NULL);
+ gdk_surface_get_device_position (surface,
+ device,
+ &event->crossing.x,
+ &event->crossing.y,
+ NULL);
event->crossing.mode = mode;
event->crossing.detail = detail;
event->crossing.focus = FALSE;
{
double x, y;
- gdk_surface_get_device_position_double (gtk_widget_get_surface (widget),
- device, &x, &y, NULL);
+ gdk_surface_get_device_position (gtk_widget_get_surface (widget),
+ device, &x, &y, NULL);
widget = gtk_widget_pick (widget, x, y);
}